package test;

public abstract class c1 {
    public static void main(String[] args) {
        c1 c = new c2();
    }

    public String s = "AAAA";

    //父类构造函数
    public c1() {
        System.out.println("父类构造");
        call();
    }

    public abstract void call() ;

}

class c2 extends c1 {
    public String s = "BBBB";

    //子类构造函数
    public c2() {
        System.out.println("子类构造");
        System.out.println(s);
    }

    //重写父类中的call函数
    public void call() {
        System.out.println("子类重写方法");
        System.out.println(s);
    }
}